﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace ShevaEngine.Core.Modules.Graphics
{
    /// <summary>
    /// Rendering pair.
    /// </summary>
    public class RenderingPackage
    {
        /// <summary>Draw call key.</summary>
        public DrawCallKey DrawCallKey;
        /// <summary>Draw call.</summary>
        public DrawCall DrawCall;
        /// <summary>Matrix.</summary>
        public Matrix Matrix;
    }


    /// <summary>
    /// Draw call comparer.
    /// </summary>
    public class RenderingPairComparer : IComparer<RenderingPackage>
    {
        /// <summary>
        /// Method compares two drawcalls.
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public int Compare(RenderingPackage x, RenderingPackage y)
        {
            return Math.Sign(x.DrawCallKey.ID - y.DrawCallKey.ID);
        }
    }
}
